var games = {} || games;
games.helper = {
    getRandomNumber: function (low, high) {
        return Math.floor(Math.random() * high) + low;
    }
}
games.gamezone = {
    bind:function(){
        var lis = $("#windows li");
        lis.each(function () {
            $(this).attr("class", "disabled");
        });
        for (var i = 0; i <= todaysDate - 13; i++) {
            var currentLi = lis[i];
            currentLi.className = "enabled";
        }
        $('#windows .enabled a').unbind("hover");
        $('#windows .enabled a').unbind("click");
        $('#windows .enabled a').hover(function () {
            $(this).stop().animate({ backgroundPosition: "(-20px 94px)" }, { duration: 500 });
        }, function () {
            $(this).stop().animate({ backgroundPosition: "(40px 35px)" }, { duration: 200, complete: function () { $(this).css({ backgroundPosition: "-20px 35px" }) } });
        });
        $('#windows .enabled a').click(function () {
            $(this).css({ "background": "blue" });
            games.gamezone.loadGame($(this).parent().attr("id"));
            return false;
        });
        $('#windows .disabled a').hover(function () {
            $(this).stop().animate({ backgroundPosition: "(0 -250px)" }, { duration: 500 })
        }, function () {
            $(this).stop().animate({ backgroundPosition: "(0 0)" }, { duration: 500 })
        });
        $('#windows .disabled a').click(function () {
            alert("This day is currently unavailable. Please come back in " + ($(this).text() - todaysDate) + " days.");
            return false;
        });
    },
    loadGame : function (gameid) {
            switch (gameid) {
                case "game1": //done
                    games.game1.init();
                    break;
                case "game2": //done
                    games.game2.init();
                    break;
                case "game3": //done
                    games.game3.init();
                    break;
                case "game4": //done
                    games.game4.init();
                    break;
                case "game5": //done
                    games.game5.init();
                    break;
                case "game6": //done
                    games.game6.init();
                    break;
                case "game7": //done
                    games.game7.init();
                    break;
                case "game8": //done
                    games.game8.init();
                    break;
                case "game9": //done
                    games.game9.init();
                    break;
                case "game10": //done
                    games.game10.init();
                    break;
                case "game11":
                    games.game11.init();
                    break;
                case "game12":
                    games.game12.init();
                    break;
            }
        }
}